import org.jsoup.Jsoup;

import javax.swing.*;
import java.io.IOException;

public class Dictionary {
    public static void main(String[] args) throws IOException {
        String input = JOptionPane.showInputDialog("请输入你要翻译的词语:");
        String url = "https://youdao.com/w/eng/" + input + "/#keyfrom=dict2.index";
        String out = Jsoup.connect(url).get().select("div[class=trans-container]").get(0).text();
        JOptionPane.showMessageDialog(null, out);
    }
}
